// app.js
App({
  onLaunch() {
    wx.getSetting({
      success(res) {
        console.log(res);
        if (res.authSetting['scope.userInfo']) {
          wx.authorize({
            scope: 'scope.userInfo',
            success() {
              // 用户已经同意授权
              console.log("登录成功！");
            },
            fail(){
              
            }
          })
        }
      }
    })
  }
})